package com.lancoo.znbkxx.teacher.widget

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import com.lancoo.znbkxx.teacher.R
import kotlinx.android.synthetic.main.dialog_loading.*

class LoadingDialog(
        context: Context?
) : Dialog(context!!, R.style.MyDialogStyle) {
    /**
     * 提交按钮
     */
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.dialog_loading)
        window!!.setGravity(Gravity.CENTER) //设置弹窗右对齐
        window!!.setWindowAnimations(android.R.style.Animation_Dialog) //设置动画效果

        //按空白处不能取消动画
        setCanceledOnTouchOutside(false)
    }

    fun show(message: String?) {
        tipTextView.text = message
        show()
    }
}